package arlpanda.lcmtypes;
 
import java.io.*;
import java.util.*;
 
public final class pimu_t implements lcm.lcm.LCMEncodable
{
    public long utime;
    public long utime_pimu;
    public int integrator[];
    public int accel[];
    public int mag[];
    public int alttemp[];
 
    public pimu_t()
    {
        integrator = new int[8];
        accel = new int[3];
        mag = new int[3];
        alttemp = new int[2];
    }
 
    public static final long LCM_FINGERPRINT;
    public static final long LCM_FINGERPRINT_BASE = 0x72fbf5453914ecf5L;
 
    static {
        LCM_FINGERPRINT = _hashRecursive(new ArrayList<Class>());
    }
 
    public static long _hashRecursive(ArrayList<Class> classes)
    {
        if (classes.contains(arlpanda.lcmtypes.pimu_t.class))
            return 0L;
 
        classes.add(arlpanda.lcmtypes.pimu_t.class);
        long hash = LCM_FINGERPRINT_BASE
            ;
        classes.remove(classes.size() - 1);
        return (hash<<1) + ((hash>>63)&1);
    }
 
    public void encode(DataOutput outs) throws IOException
    {
        outs.writeLong(LCM_FINGERPRINT);
        _encodeRecursive(outs);
    }
 
    public void _encodeRecursive(DataOutput outs) throws IOException
    {
        byte[] __strbuf = null;
        outs.writeLong(this.utime); 
 
        outs.writeLong(this.utime_pimu); 
 
        for (int a = 0; a < 8; a++) {
            outs.writeInt(this.integrator[a]); 
        }
 
        for (int a = 0; a < 3; a++) {
            outs.writeInt(this.accel[a]); 
        }
 
        for (int a = 0; a < 3; a++) {
            outs.writeInt(this.mag[a]); 
        }
 
        for (int a = 0; a < 2; a++) {
            outs.writeInt(this.alttemp[a]); 
        }
 
    }
 
    public pimu_t(byte[] data) throws IOException
    {
        this(new DataInputStream(new ByteArrayInputStream(data)));
    }
 
    public pimu_t(DataInput ins) throws IOException
    {
        if (ins.readLong() != LCM_FINGERPRINT)
            throw new IOException("LCM Decode error: bad fingerprint");
 
        _decodeRecursive(ins);
    }
 
    public static arlpanda.lcmtypes.pimu_t _decodeRecursiveFactory(DataInput ins) throws IOException
    {
        arlpanda.lcmtypes.pimu_t o = new arlpanda.lcmtypes.pimu_t();
        o._decodeRecursive(ins);
        return o;
    }
 
    public void _decodeRecursive(DataInput ins) throws IOException
    {
        byte[] __strbuf = null;
        this.utime = ins.readLong();
 
        this.utime_pimu = ins.readLong();
 
        this.integrator = new int[(int) 8];
        for (int a = 0; a < 8; a++) {
            this.integrator[a] = ins.readInt();
        }
 
        this.accel = new int[(int) 3];
        for (int a = 0; a < 3; a++) {
            this.accel[a] = ins.readInt();
        }
 
        this.mag = new int[(int) 3];
        for (int a = 0; a < 3; a++) {
            this.mag[a] = ins.readInt();
        }
 
        this.alttemp = new int[(int) 2];
        for (int a = 0; a < 2; a++) {
            this.alttemp[a] = ins.readInt();
        }
 
    }
 
    public arlpanda.lcmtypes.pimu_t copy()
    {
        arlpanda.lcmtypes.pimu_t outobj = new arlpanda.lcmtypes.pimu_t();
        outobj.utime = this.utime;
 
        outobj.utime_pimu = this.utime_pimu;
 
        outobj.integrator = new int[(int) 8];
        for (int a = 0; a < 8; a++) {
            outobj.integrator[a] = this.integrator[a];
        }
 
        outobj.accel = new int[(int) 3];
        for (int a = 0; a < 3; a++) {
            outobj.accel[a] = this.accel[a];
        }
 
        outobj.mag = new int[(int) 3];
        for (int a = 0; a < 3; a++) {
            outobj.mag[a] = this.mag[a];
        }
 
        outobj.alttemp = new int[(int) 2];
        for (int a = 0; a < 2; a++) {
            outobj.alttemp[a] = this.alttemp[a];
        }
 
        return outobj;
    }
 
}

